package com.hyzx.qbasic.admin.common.util;

import com.hyzx.qbasic.admin.model.vo.res.BaseOperationRes;
import org.apache.commons.lang3.StringUtils;

/**
 * Created by 黄江华 on 2018/4/24
 */

public class OperationResUtils {
    public static BaseOperationRes success() {
        BaseOperationRes response = new BaseOperationRes(true);
        return response;
    }

    public static <T> BaseOperationRes<T> success(T data) {
        BaseOperationRes response = new BaseOperationRes(true, StringUtils.EMPTY, data);
        return response;
    }

    public static BaseOperationRes fail(String errMsg) {
        BaseOperationRes response = new BaseOperationRes(false, errMsg);
        return response;
    }
}
